package com.css.fxfzysx.modules.ysxManagement.controller;

import com.css.fxfzysx.base.response.RestResponse;
import com.css.fxfzysx.modules.ysxManagement.service.WsfCoefficientService;
import com.css.fxfzysx.modules.ysxManagement.vo.RsRatioVo;
import com.css.fxfzysx.modules.ysxManagement.vo.WsfCoefficientVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 供水设施系数维护
 */
@RestController
@RequestMapping("wsfCoefficient")
public class WsfCoefficientController {

    @Autowired
    private WsfCoefficientService wsfCoefficientService;

    /**
     *供水设施震害预测等级添加或修改
     * @param wsfCoefficientVo
     * @return
     */
    @PostMapping("saveOrUpdateWsfCoefficient")
    public RestResponse saveOrUpdateWsfCoefficient(@RequestBody WsfCoefficientVo wsfCoefficientVo){
        return wsfCoefficientService.saveOrUpdateWsfCoefficient(wsfCoefficientVo);
    }

    /**
     * 供水设施震害预测等级查询
     * @param titleName
     * @return
     */
    @GetMapping("getAllWsfCoefficient")
    public RestResponse getAllWsfCoefficient(String titleName){
        return wsfCoefficientService.getAllWsfCoefficient(titleName);
    }

    /**
     * 供水设施震害预测等级删除
     * @param wsfCoefficientIds
     * @return
     */
    @GetMapping("deleteWsfCoefficientById")
    public RestResponse deleteWsfCoefficientById(String wsfCoefficientIds,String arrangeIds){
        return wsfCoefficientService.deleteWsfCoefficientById(wsfCoefficientIds,arrangeIds);
    }

    /**
     * v与纵向受拉钢筋表面形状有关的系数添加或修改
     * @param rsRatioVo
     * @return
     */
    @PostMapping("saveOrUpdateRsRatio")
    public RestResponse saveOrUpdateRsRatio(@RequestBody RsRatioVo rsRatioVo){
        return wsfCoefficientService.saveOrUpdateRsRatio(rsRatioVo);
    }

    /**
     * v与纵向受拉钢筋表面形状有关的系数查询
     * @param titleName
     * @return
     */
    @GetMapping("getAllRsRatio")
    public RestResponse getAllRsRatio(String titleName){
        return wsfCoefficientService.getAllRsRatio(titleName);
    }

    /**
     * v与纵向受拉钢筋表面形状有关的系数删除
     * @param rsRatioIds
     * @return
     */
    @GetMapping("deleteRsRatioById")
    public RestResponse deleteRsRatioById(String rsRatioIds,String arrangeIds){
        return wsfCoefficientService.deleteRsRatioById(rsRatioIds,arrangeIds);
    }
}
